package com.cash.channel.api.model.enums;

public enum HomeLoanTypeEnum {
    ANONYMOUS(1,"游客"),
    NOT_SUBMIT(2,"未提交"),
    AUTHING(3,"待决策"),
    AUTH_PASSING_DIS(4,"决策通过，额度失效"),
    AUTH_PASSING(5,"决策通过，额度有效"),
    AUTH_REFUSE(6,"决策拒绝"),
    WITHDRAW_NOT(7,"未提现"),
    WITHDRAW_ING(8,"提现审核中"),
    WITHDRAW_SETTLE(9,"所有提现订单已结清"),
    WITHDRAW_PASSED_WATING(10,"资金方放款失败"),//原(提现审核通过,放款中)
    WITHDRAW_PASSED_FALID(11,"提现审核通过,放款失败"),
    WITHDRAW_REPAY_OVER(12,"放款成功,已逾期"),
    WITHDRAW_REPAY_NORM(13,"放款成功, 正常还款"),
    WITHDRAW_REFUSE(14,"提现审核失败"),
    WITHDRAW_FUND_REFUSE(15,"提现资金方审核失败"),
    ;

    private int type;
    private String desc;
    HomeLoanTypeEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }

    public int getLoanType() {
        return type;
    }

    public static String getDesc(Integer code) {
        for (HomeLoanTypeEnum homeLoanType : values()) {
            if (homeLoanType.getLoanType()==code) {
                return homeLoanType.getDesc();
            }
        }
        throw new RuntimeException("未找到对应的枚举");
    }
}